﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
   String path = request.getContextPath();
		String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	%>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="shortcut icon" href="image/favicons.ico" type="image/x-icon" />
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <!-- Bootstrap 3.3.2 -->
    <link href="../common/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Font Awesome Icons -->
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="../common/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <!-- iCheck -->
    <link href="../common/plugins/iCheck/square/blue.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    	.col-md-4{
    		padding-left:0px;
    		padding-right:3px;
    	}
    </style>
  <section class="content">
        <div class="row">
    <div class="login-box">
      <div class="login-logo">
        <b>管理员登录</b>
      </div><!-- /.login-logo -->
      <div class="login-box-body">
        <form id="login" method="post">
          <div class="form-group has-feedback">
            <input type="text" class="form-control" placeholder="账号" required name="username"/>
            <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
          </div>
          <div class="form-group has-feedback">
            <input type="password" class="form-control" placeholder="密码" required name="password"/>
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
          </div>

          <div class="row">
            <div class="col-xs-12" style="margin-top: 10px;">
            <input type="button" id="log" class="btn btn-primary btn-block btn-flat" value="登录"/>
              <!--<button type="button" id="log" class="btn btn-primary btn-block btn-flat">登录</button>
            --></div><!-- /.col -->
          </div>
        </form>
      </div><!-- /.login-box-body -->
   </div>
     <div id="messageModal" class="modal fade">
		  <div class="modal-dialog">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		        <h4 class="modal-title">系统提示</h4>
		      </div>
		      <div class="modal-body">
		      	<div><span id="messagespan"></span></div>
		      </div>
		      <div class="modal-footer">
		        <button type="button"  class="btn btn-default" data-dismiss="modal">确定</button>
		      </div>
		    </div><!-- /.modal-content -->
		  </div><!-- /.modal-dialog -->
		</div><!-- /.modal -->
		</div>
   </section>

    <!-- jQuery 2.1.3 -->
    <script src="../common/plugins/jQuery/jQuery-2.1.3.min.js"></script>
    <!-- Bootstrap 3.3.2 JS -->
    <script src="../common/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <!-- iCheck -->
    <script src="../common/plugins/iCheck/icheck.min.js" type="text/javascript"></script>
    <script>
		$(function(){

			$("#change").click(function(){
				$("#security ").prop("src","<%=basePath%>admin/securityCode?id="+Math.random())
			})
			
			$("#security").click(function(){
				$(this).prop("src","<%=basePath%>admin/securityCode?id="+Math.random());
				});
	 
		
		$("#log").click(function(){
    						$.ajax({
    						url:"<%=basePath%>admin/log",
    						type:'post',
    						data:$("#login").serialize(),
    						success:function(data){
    							if(data.success){
    									location.href=data.url;
    							}else{
    									alert(data.message);
    								}
    						}
    						});
    			});  
    			});
    
      $(function () {
        $('input').iCheck({
          checkboxClass: 'icheckbox_square-blue',
          radioClass: 'iradio_square-blue',
          increaseArea: '20%' // optional
        });
      });
    </script>
